<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        
    </style>
</head>
<body>
    
</body>
<script>

    // let str1 = "hello \n    world";
    // let str2 = 'hello \nworld';
    // let str3 = `hello 
    // world`;
    // console.log(str1);
    // console.log(str2);
    // console.log(str3);

    // let msg = "张三"

    // let str1 = "hello '"+ msg +"' world";
    // let str2 = 'hello "'+ msg +'" world';
    // let str3 = `hello '"'${msg}'"'"' world`;
    // let str4 = `hello ${1+1} world`;
    // console.log(str1);
    // console.log(str2);
    // console.log(str3);
    // console.log(str4);


    // =======


    // let str = "hello"

    // console.log( str.repeat(5) );

    // console.log( str.includes("e") );
    // console.log( str.includes("a") );

    // console.log( str.startsWith("h") );
    // console.log( str.startsWith("a") );
    
    // console.log( str.endsWith("o") );
    // console.log( str.endsWith("a") );



    // 常用字：一个四位十六进制组成
    // 生僻字：两个四位十六进制组成

    let str = "𠮶";
    console.log(str.length);
    console.log(str.charCodeAt(0));
    console.log(str.charCodeAt(1));
    console.log(String.fromCharCode(55362, 57270));

    // 新的unicode编码：一个五位的十六进制表示
    console.log(str.codePointAt());
    console.log(String.fromCodePoint(134070));
    console.log(String.fromCodePoint("0x20bb6"));

    console.log("\u{20bb6}");
    console.log("\u{20bb9}");

    console.log("龍".length);
    console.log("龍".charCodeAt());
    console.log(String.fromCharCode(40845));

    console.log("龍".codePointAt());
    console.log(String.fromCodePoint(40845));

    
</script>
</html>